package com.ruoyi.teacher.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.teacher.domain.TQuestionBank;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teacher.mapper.TPaperQuestionMapper;
import com.ruoyi.teacher.domain.TPaperQuestion;
import com.ruoyi.teacher.service.ITPaperQuestionService;

/**
 * 试卷问题Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-01
 */
@Service
public class TPaperQuestionServiceImpl implements ITPaperQuestionService 
{
    @Autowired
    private TPaperQuestionMapper tPaperQuestionMapper;



    /**
     * 查询试卷问题
     * 
     * @param id 试卷问题主键
     * @return 试卷问题
     */
    @Override
    public TPaperQuestion selectTPaperQuestionById(Long id)
    {
        return tPaperQuestionMapper.selectTPaperQuestionById(id);
    }

    /**
     * 查询试卷问题列表
     * 
     * @param tPaperQuestion 试卷问题
     * @return 试卷问题
     */
    @Override
    public List<TPaperQuestion> selectTPaperQuestionList(TPaperQuestion tPaperQuestion)
    {
        return tPaperQuestionMapper.selectTPaperQuestionList(tPaperQuestion);
    }

    /**
     * 新增试卷问题
     * 
     * @param tPaperQuestion 试卷问题
     * @return 结果
     */
    @Override
    public int insertTPaperQuestion(TPaperQuestion tPaperQuestion)
    {
        tPaperQuestion.setCreateTime(DateUtils.getNowDate());
        return tPaperQuestionMapper.insertTPaperQuestion(tPaperQuestion);
    }

    /**
     * 修改试卷问题
     * 
     * @param tPaperQuestion 试卷问题
     * @return 结果
     */
    @Override
    public int updateTPaperQuestion(TPaperQuestion tPaperQuestion)
    {
        tPaperQuestion.setUpdateTime(DateUtils.getNowDate());
        return tPaperQuestionMapper.updateTPaperQuestion(tPaperQuestion);
    }

    /**
     * 批量删除试卷问题
     * 
     * @param ids 需要删除的试卷问题主键
     * @return 结果
     */
    @Override
    public int deleteTPaperQuestionByIds(Long[] ids)
    {
        return tPaperQuestionMapper.deleteTPaperQuestionByIds(ids);
    }

    /**
     * 删除试卷问题信息
     * 
     * @param id 试卷问题主键
     * @return 结果
     */
    @Override
    public int deleteTPaperQuestionById(Long id)
    {
        return tPaperQuestionMapper.deleteTPaperQuestionById(id);
    }


}
